import Vue from 'vue';
import Vuex from 'vuex';

Vue.use(Vuex);

const store = new Vuex.Store({
    state: {
        navigateSelectIndex:0,//一级导航当前选中的编号
        naviSecondSelectIndex:0//二级导航当前选中的编号
    },
    mutations: {
        //这里是set方法
        setNavigateSelectIndex(state,newValue){
            state.navigateSelectIndex = newValue;
        },
        setNaviSecondSelectIndex(state,newValue){
            state.naviSecondSelectIndex = newValue;
        }
    },
    getters: {
        //get方法
        getNavigateSelectIndex: state => state.navigateSelectIndex,
        getNaviSecondSelectIndex: state => state.naviSecondSelectIndex

    }
 


});

export default store;
